The present invention relates to a coding device for an image processing apparatus such as a facsimile apparatus.
In an image processing apparatus, typically a facsimile apparatus, picture data are usually coded before transmission in order to enhance the transmission efficiency of images. The problem hitherto encountered with picture data coding is that the number of bits of data after coding is not always smaller than that of data before coding and it is not seldom that the former is larger than the latter. In the case of a modified Huffman (MH) run-length coding system, for example, a stream of 2,048 bits which constitutes one line of picture data (applying to a B4 format and a resolution of 8 dots per millimeter) turns into a stream of 32 to 9,236 bits inclusive of an end-of-linesync (EOL) code. A few systems have been proposed in the image processing art which are elaborated to make the number of bits of picture data produced by a coding device at least smaller than that of noncoded data, as will be described.
In accordance with a first proposed system, one unit block of data (one line of data concerning facsimile) are coded and stored in a buffer memory, while the amount of data being stored is constantly monitored. As soon as the number of the stored data bits exceeds the number of bits which constitutes one unit block of non-coded data, the coding operation is interrupted and that unit block of data are directly outputted as non-coded data.
A second proposed system is to count the number of runs (white/black transition points) in each one unit block of data before coding the data, and output the data without coding them if the counted number of runs is greater than a predetermined one.
A third proposed system is such that when the number of bits of a unit block of coded data has become greater than that of a unit block of non-coded data, the subsequent unit block or blocks are outputted as non-coded data until a unit block having a smaller number of bits of coded data than non-coded data appears. Then, coded data are outputted for the next unit and subsequent unit blocks.
All such prior art systems applied to facsimile, for example, allow one line of data, 2,048 bits, to be transmitted in 32 to (2,048 plus control codes) bits, which is a substantial improvement in transmission efficiency. In addition, where the output coded data are to be routed to a store, it is possible to scale down the capacity of the store.
However, the first and second systems commonly suffer from a drawback that a lot of buffer memories are indispensable. Another drawback is that since the first system has to code even the data which do not have to be coded and the second system has to count the runs beforehand to selectively code data based on the number of runs, the first and second systems are redundant and complicated in processing and, moreover, consume a long period of processing time due to the need for repeated entry of the same non-coded data into a coding device. Meanwhile, the third system is inherently intricate in control inasmuch as it has to code data even while non-coded data are being outputted.